// =================================================================================================
// ADOBE SYSTEMS INCORPORATED
// Copyright 2006 Adobe Systems Incorporated
// All Rights Reserved
//
// NOTICE:  Adobe permits you to use, modify, and distribute this file in accordance with the terms
// of the Adobe license agreement accompanying it.
// =================================================================================================

/**
 * This exception wraps all errors that occur in the XMP Toolkit.
 */
export default  class XMPException extends Error {
    /** the errorCode of the XMP toolkit */
    private errorCode: number;

    /**
     * Constructs an exception with a message and an error code. 
     * @param message the message
     * @param errorCode the error code
     */
    // constructor(message: string, errorCode: number) {
    //     super(message);
    //     this.errorCode = errorCode;
    //     this.name = 'XMPException';
    // }

    /**
     * Constructs an exception with a message, an error code and a <code>Throwable</code>
     * @param message the error message.
     * @param errorCode the error code
     * @param t the exception source
     */
    constructor(message: string, errorCode: number, t?: Error) {
        super(message);
        this.errorCode = errorCode;
        this.name = 'XMPException';
    }

    /**
     * @return Returns the errorCode.
     */
    public getErrorCode(): number {
        return this.errorCode;
    }
}

